/*
 * EmployeeListTest.java
 *
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.javacore.day11.employeelist;

import java.util.Scanner;

/**
 *
 * @author somap
 */
public class EmployeeListTest {
  
  /** Creates a new instance of EmployeeListTest */
  protected EmployeeListTest() {
  }
  
  public static void main(final String [] args) {
    
    
    EmployeeList employeeListObj = new EmployeeList();
    
    Scanner input = new Scanner(System.in);
    
    // Variable to store the name to be searched
    String name;
    
    // Variable to store the option selected by the user
    int choice;
    
    do {
      System.out.println("\n Select the operation you want to perform:");
      System.out.println("******************************************");
      System.out.println("1. Add Employees to the list");
      System.out.println("2. Search employee by name");
      System.out.println("3. Display the list");
      System.out.println("4. Exit");
      System.out.println("******************************************");
      choice = input.nextInt();
      
      // Invoke various methods depending on the operation
      // selected by the user
      switch(choice){
        case 1:
          employeeListObj.add();
          break;
        case 2:
          employeeListObj.search();
          break;
        case 3:
          employeeListObj.display();
          break;
        case 4:
          break;
        default:
          System.out.println("Not a valid choice");
      }
    } while(choice != 4);   
    
  }
  
}
